'use strict';
module.exports = (app) => {
  const { STRING, INTEGER, TEXT } = app.Sequelize;
  const News = app.model.define('w_news', {
    id: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    cover: {
      comment: '封面图',
      type: TEXT('long'),
      allowNull: false,
    },
    title: {
      comment: '新闻标题',
      type: TEXT('long'),
      allowNull: false,
    },
    sketch: {
      comment: '新闻简述',
      type: TEXT('long'),
    },
    content: {
      comment: '新闻内容',
      type: TEXT,
    },
    readCount: {
      comment: '阅读次数',
      type: INTEGER,
      defaultValue: 0,
    },
    projectId: {
      comment: '项目id',
      type: INTEGER,
      allowNull: false,
    },
  });
  return News;
};
